package com.study.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the permission database table.
 * 
 */
@Entity
@NamedQuery(name="Permission.findAll", query="SELECT p FROM Permission p")
public class Permission implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="per_id")
	private int perId;

	@Column(name="per_name")
	private String perName;

	@Column(name="per_surid")
	private int perSurid;

	//bi-directional many-to-many association to Role
	@ManyToMany
	@JoinTable(
		name="rolepermission"
		, joinColumns={
			@JoinColumn(name="per_id")
			}
		, inverseJoinColumns={
			@JoinColumn(name="rol_id")
			}
		)
	private List<Role> roles;

	public Permission() {
	}

	public int getPerId() {
		return this.perId;
	}

	public void setPerId(int perId) {
		this.perId = perId;
	}

	public String getPerName() {
		return this.perName;
	}

	public void setPerName(String perName) {
		this.perName = perName;
	}

	public int getPerSurid() {
		return this.perSurid;
	}

	public void setPerSurid(int perSurid) {
		this.perSurid = perSurid;
	}

	public List<Role> getRoles() {
		return this.roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

}